/**
 * Created by Administrator on 2017/3/21.
 */
import React, {Component} from 'react';
import { Form, Input, DatePicker, Select, InputNumber,  Button } from 'antd';
import {connect} from 'dva';
import moment from 'moment'
import request from '@/utils/request';
import 'braft-editor/dist/index.css'
import BraftEditor from 'braft-editor'
import config from '@/config/config'
import {download,getFileType} from '@/utils/utils';
import find from 'lodash/find';
import Zmage from 'react-zmage';
const FormItem = Form.Item;
const Option = Select.Option;
class AddPoliciesForm extends Component {
  constructor(props) {
    super(props);
    this.state = {
      all_roles:[],
      html:'', // 设置编辑器初始内容
    };
  }
  componentDidMount() {
    const mailHistory=this.props.mailHistory
    if(mailHistory){
      this.setState({
        html:mailHistory
      })
    }
  }
  render() {



    return (
      <div>
        {
          this.props.editRecord.cover_image_path?<div style={{padding:'10px 15px',background:'rgb(242, 242, 242)',fontSize:'16px'}}>

              <h4 style={{marginBottom:'0',color:'#555'}}>封面图片 : <Zmage src={this.props.editRecord.cover_image_path} alt="" style={{ width: 200 }}/>
              </h4>
        </div>
            :''
        }
        <h2 style={{width:'80%',margin:'5px auto',textAlign:'center',fontWeight:'bold'}}>{this.props.editRecord.title}</h2>
        <div className="detailImgWrap"  style={{padding:'10px',fontSize:'16px'}} dangerouslySetInnerHTML={{ __html:this.props.editRecord.content}}></div>
        {
          this.props.editRecord.reprinted_source?
            <h3>来源 : {this.props.editRecord.reprinted_source}</h3>:''
        }
      </div>
    );
  }
}

const AddPoliciesFormWrap = Form.create()(AddPoliciesForm);
export default connect()(AddPoliciesFormWrap);


